package com.yanyeori.nacosfeign.context;

import com.yanyeori.framework.core.context.ContextHolder;
import org.springframework.core.NamedThreadLocal;

/**
 * @author chenkuan
 * @since 2021/8/2 002 18:14
 */
public class AContextHolder extends ContextHolder {

    private static final ThreadLocal<AContext> A_CONTEXT_THREAD_LOCAL = new NamedThreadLocal<>("a_info");

    public static AContext getAContext() {
        return A_CONTEXT_THREAD_LOCAL.get();
    }

    public static void setAContext(AContext aContext) {
        A_CONTEXT_THREAD_LOCAL.set(aContext);
    }

    public static void clear() {
        A_CONTEXT_THREAD_LOCAL.remove();
    }
}
